﻿using System.Windows;
using System.Windows.Input;

namespace LFSRecord2.View.Dialogs
{
    /// <summary>
    /// Interaction logic for RDToNullDialogBox.xaml
    /// </summary>
    public partial class RDToNullDialogBox : Window
    {
        public RDToNullDialogBox()
        {
            InitializeComponent();
        }

        void OKButton_Click(object sender, RoutedEventArgs e)
        {
            // Don't accept the dialog box if there is invalid data - we use our own check for this (less code), skipping the default validation rules
            double newValue = 0;
            if (!double.TryParse(FrameThinningValue.Text, out newValue))
            {
                Keyboard.Focus(FrameThinningValue);
                return;
            }
            // Dialog box accepted
            this.DialogResult = true;
        }
    }
}
